package Generics;

public class Test2 {
    public static void main(String[] args) {

        MyArray2<Integer> myArray2 = new MyArray2<Integer>();
//        MyArray2<String> myArray3 = new MyArray2<String>();
    }
}

class MyArray2 <E extends Number> {
    public Object[] array = new Object[10];

    public void setArray(int pos, E value) {
        this.array[pos] = value;
    }

    public E getArray(int pos) {
        return (E)array[pos];
    }
}